> Title -> [Port->Eng] (Example: Portuguese to English)
> Shortcut -> Choice
> Macro -> AWeb3:Plugins/FTransAWEB.awebrx 3 (3 is a translation direction)
> Select text for translation
> Go to AREXX Menu and select [Port->Eng]
> Wait for windows with translation :)
0 - English to Francais
1 - English to Deutsch
2 - English to Italiano
3 - English to Portugues
4 - English to Espanol
5 - Francais to English
6 - Deutsch to English
7 - Italiano to English
8 - Espanol to English
9 - Portugues to English
*/
Options Results
tmpfile = 'Ram:FTransTmp.AWEB'
tmpclip = 'Ram:FTransAWeb.Clip'
sel = ''
ARG traduz
/* TESTA SE PODE SER USADAS AS LIBS DO AREXX */
if ~show(l, "rexxsupport.library") then
if ~addlib("rexxsupport.library", 0, -30) then
exit
/* TESTA SE O PROGRAMA JA NAO ESTA COM A PORTA DE TRADUCAO ABERTA */
if exists(tmpfile) then do
janela('"FTranslation port is open! Translation in progress, wait..." "_Ok"')
exit
end
/* COLOCA COMO DEFAULT PORTUGUES TO ENGLISH */
if traduz = "" then do
traduz = requestaweb('"Select your translate direction:*N 1) English to Francais*N 2) English to Deutsch*N 3) English to Italiano*N 4) English to Portugues*N 5) English to Espanol*N 6) Francais to English*N 7) Deutsch to English*N 8) Italiano to English*N 9) Espanol to English*N10) Portugues to English" "1|2|3|4|5|6|7|8|9|10|Quit"')
if(traduz = 0) then
exit
traduz = traduz - 1
end
/* PEGA O CONTEUDO MARCADO E RETIRA OS ENTERS */
'get selection var sel'
/* TESTA SE FOI MARCADO O TEXTO */
if sel = '' then do
janela('"You need select text first..." "_Ok"')
exit
end
/* SALVA CONTEUDO MARCADO NO ARQUIVO TEMPORARIO */
call open(1, tmpclip, 'W')
call writeln(1, sel)
call close(1)
/* EXECUTA O FTRANSLATOR COM OS ARGUMENTOS DA TRADUCAO */